package com.asset.salesforce.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@SuppressWarnings("serial")
@Entity
@Table(name = "employee")
public class Employee implements Serializable {
	
	private Integer id;
	private File photo;
	private String empInfo;
	private String fName;
	private String lName;
	private String nickName;
	private String email;
	private Company company;
	private Country country;
	private JobTitle jobTitle;
	private Department dept;
	private Employee manager;
	private Date registerDate;
	private Boolean isActive;
	private Boolean isOwner;
	private Boolean firstLogin;
	private Set<Employee> employees;
	private Boolean isFollowed;
	
	private Date dateCreated;
	private Date dateModified;
	
	/**
	 * @return the employees
	 */
	@OneToMany(mappedBy="manager")
	public Set<Employee> getEmployees() {
		return employees;
	}
	/**
	 * @param employees the employees to set
	 */
	public void setEmployees(Set<Employee> employees) {
		this.employees = employees;
	}
	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="employee_id_seq")
	@SequenceGenerator(name="employee_id_seq",sequenceName="employee_id_seq",allocationSize=1)
	public Integer getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}
	/**
	 * @return the photoId
	 */
	@OneToOne
	@JoinColumn(name = "photo_id")
	public File getPhoto() {
		return photo;
	}
	/**
	 * @param photoId the photoId to set
	 */
	
	public void setPhoto(File photo) {
		this.photo = photo;
	}
	/**
	 * @return the empInfo
	 */
	@Column(name="emp_info")
	public String getEmpInfo() {
		return empInfo;
	}
	/**
	 * @param empInfo the empInfo to set
	 */
	public void setEmpInfo(String empInfo) {
		this.empInfo = empInfo;
	}
	/**
	 * @return the fName
	 */
	@Column(name="f_name")
	public String getfName() {
		return fName;
	}
	/**
	 * @param fName the fName to set
	 */
	
	public void setfName(String fName) {
		this.fName = fName;
	}
	/**
	 * @return the lName
	 */
	@Column(name="l_name")
	public String getlName() {
		return lName;
	}
	/**
	 * @param lName the lName to set
	 */
	public void setlName(String lName) {
		this.lName = lName;
	}
	/**
	 * @return the nickName
	 */
	@Column(name="nick_name")
	public String getNickName() {
		return nickName;
	}
	/**
	 * @param nickName the nickName to set
	 */
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	/**
	 * @return the email
	 */
	@Column(name="email")
	public String getEmail() {
		return email;
	}
	/**
	 * @param email the email to set
	 */
	public void setEmail(String email) {
		this.email = email;
	}
	/**
	 * @return the companyId
	 */
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="company_id")
	public Company getCompany() {
		return company;
	}
	/**
	 * @param companyId the companyId to set
	 */
	public void setCompany(Company company) {
		this.company = company;
	}
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="country_id")
	public Country getCountry() {
		return country;
	}
	public void setCountry(Country country) {
		this.country = country;
	}
	/**
	 * @return the jobTitleId
	 */
	@ManyToOne
	@JoinColumn(name="job_title_id")
	public JobTitle getJobTitle() {
		return jobTitle;
	}
	/**
	 * @param jobTitleId the jobTitleId to set
	 */
	public void setJobTitle(JobTitle jobTitle) {
		this.jobTitle = jobTitle;
	}
	/**
	 * @return the debtId
	 */
	@ManyToOne
	@JoinColumn(name="dept_id")
	public Department getDept() {
		return dept;
	}
	/**
	 * @param debtId the debtId to set
	 */
	public void setDept(Department dept) {
		this.dept = dept;
	}
	/**
	 * @return the managerId
	 */
	@ManyToOne
	@JoinColumn(name="manager_id")
	public Employee getManager() {
		return manager;
	}
	
	
	/**
	 * @param managerId the managerId to set
	 */
	public void setManager(Employee manager) {
		this.manager = manager;
	}
	/**
	 * @return the registerDate
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="register_date")
	public Date getRegisterDate() {
		return registerDate;
	}
	/**
	 * @param registerDate the registerDate to set
	 */
	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}
	/**
	 * @return the isActive
	 */
	@Column(name="is_active")
	public Boolean getIsActive() {
		return isActive;
	}
	/**
	 * @param isActive the isActive to set
	 */
	public void setIsActive(Boolean isActive) {
		this.isActive = isActive;
	}
	/**
	 * @return the isOwner
	 */
	@Column(name="is_owner")
	public Boolean getIsOwner() {
		return isOwner;
	}
	/**
	 * @param isOwner the isOwner to set
	 */
	public void setIsOwner(Boolean isOwner) {
		this.isOwner = isOwner;
	}
	/**
	 * @return the isFollowed
	 */
	@Transient
	public Boolean getIsFollowed() {
		return isFollowed;
	}
	/**
	 * @param isFollowed the isFollowed to set
	 */
	public void setIsFollowed(Boolean isFollowed) {
		this.isFollowed = isFollowed;
	}
	
	@Column(name="first_login")
	public Boolean getFirstLogin() {
		return firstLogin;
	}
	public void setFirstLogin(Boolean firstLogin) {
		this.firstLogin = firstLogin;
	}
	/**
	 * @return the dateCreated
	 */
	@Temporal(value=TemporalType.TIMESTAMP)
	@Column(name="date_created")
	public Date getDateCreated() {
		return dateCreated;
	}
	/**
	 * @param dateCreated the dateCreated to set
	 */
	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}
	/**
	 * @return the dateModified
	 */
	@Temporal(value = TemporalType.TIMESTAMP)
	@Column(name="date_modified")
	public Date getDateModified() {
		return dateModified;
	}
	/**
	 * @param dateModified the dateModified to set
	 */
	public void setDateModified(Date dateModified) {
		this.dateModified = dateModified;
	}
	
	

}
	
		
